using System;
using System.Collections.Generic;
using System.Text;
using Buka.BLL.Model;
using Buka.DAL;

namespace Buka.BLL.Provider
{
    public class StatusProvider
    {
        private Buka.DAL.UsersTableAdapters.StatusesTableAdapter _statusTableAdapter;

        public StatusProvider()
        {
            _statusTableAdapter = new Buka.DAL.UsersTableAdapters.StatusesTableAdapter();
        }

        #region "Fill & Get"

        public void FillObject(Buka.DAL.Users.StatusesRow row, Status obj)
        {
            obj.Id = row.id;
            obj.Caption = row.caption;
            if (row.IsdescriptionNull())
            {
                obj.Description = "";
            }
            else
            {
                obj.Description = row.description;
            }
        }

        public Status GetObject(Buka.DAL.Users.StatusesRow row)
        {
            Status status = new Status();
            try
            {
                FillObject(row, status);
            }
            catch (Exception ex)
            {

                throw new ArgumentException(ex.Message);
            }
            return status;
        }

        #endregion
    }
}
